<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>清除浮动来把外层的div撑开方案二</title>
    <style type="text/css">
      .clearfix:after {
        content: "";
        display: block;
        height: 0;
        overflow: hidden;
        clear: both;
      }
      html .clearfix {
        *zoom: 1;
      }
      *:first-child + html .clearfix {
        zoom: 1;
      }
    </style>
  </head>
  <body>
    <div class="clearfix" style="border: 2px solid red">
      <div style="float: left; width: 80px; height: 80px; border: 1px solid blue">
        TEST DIV
      </div>
    </div>
  </body>
</html>
